<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 光的代言人
  Date: 2024/12/17
  Time: 20:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>在线购物商城</title>
    <link rel="stylesheet" href="../css/shop.css">
</head>
<body>
<script src="${pageContext.request.contextPath}/jsp/shop.js"></script>
<div class="header">
    <div class="header-content">
        <a href="#" class="logo">在线购物商城</a>
        <form class="search-box" action="/shopping/list" method="get">
            <input type="text" class="search-input" placeholder="请输入商品名称" name="searchName" value="${searchName}">
            <button class="search-btn">搜索</button>
        </form>
        <ul class="clearfix user-actions">
            <li>
                <a href="/shopping/cartInfo/list">购物车</a>
            </li>
            <li>
                <a href="">我的订单</a>
            </li>
            <li>
                <a href="">个人中心
                    <ul class="downlist clearfix">
                        <li>
                            <a href="">修改个人信息</a>
                        </li>
                        <li>
                            <a href="">修改收货地址</a>
                        </li>
                        <li>
                            <a href="/login">退出登录</a>
                        </li>
                    </ul>
                </a>
            </li>
        </ul>
    </div>
</div>


<div class="category-nav">
    <ul class="category-list">
        <li class="category-item active">
            <a href="/shopping/list">全部商品</a>
        </li>
        <li class="category-item">
            <a href="/shopping/list?searchType='服装'">服装</a>
        </li>
        <li class="category-item">
            <a href="/shopping/list?searchType='鞋靴'">鞋靴</a>
        </li>
        <li class="category-item">
            <a href="/shopping/list?searchType='水果'">水果</a>
        </li>
        <li class="category-item">
            <a href="/shopping/list?searchType='电子产品'">电子产品</a>
        </li>
        <li class="category-item">
            <a href="/shopping/list?searchType='医药'">医药</a>
        </li>

    </ul>
</div>

<div class="main-content">
    <div class="product-grid">
        <!-- 商品展示 -->
<%--        <%=request.getAttribute("goodsInfoList")%>--%>
        <c:forEach items="${goodsInfoList}" var="map">
            <a href="/shopping/detail?id=${map.goods_id}">
                <div class="product-card">
                    <img src="/goodsPic/${map.pic}" alt="" class="product-image">
                    <div class="product-title">${map.goods_name}</div>
                    <div class="product-price">${map.price}</div>
                </div>
            </a>
        </c:forEach>

    </div>
</div>

</body>
</html>
